package cn.edu.xjtu.competiton.Acwing.AcWingCup1.first;

import java.util.Scanner;

/**
 * https://www.acwing.com/problem/content/4379/
 */
public class Solution {
    public static void main(String[] args) {
        int[] arr = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 0, 1, 0, 0};
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.close();
        int ans = 0;
        if (n == 0) {
            System.out.println(0);
            return;
        }
        while (n > 0) {
            ans += arr[n % 16];
            n = n / 16;
        }
        System.out.println(ans);
    }
}
